#include "timer.h"

struct timer_device_data timer4_data=
{
    {
        1,RCC_APB1RSTR_TIM4RST_Pos,
    },
    {
        TIM4_IRQn,1,3,
    },
    {
        TIM4_BASE,
        7200-1,//    sj_int8   prescaler;
        2000-1,//    sj_int8   period;
        TIM_COUNTERMODE_UP,//    sj_int8   mode;
        TIM_CLOCKDIVISION_DIV1,//    sj_int8   division;
        4,
    },
};

static struct device timer4_device={
    "/dev/timer4",
    "timer",
     0,
    NULL,
    (sj_void *)&timer4_data,
};

static DEVICE_MODULE_INIT(timer4_device)


struct timer_device_data timer3_data=
{
    {
        1,RCC_APB1RSTR_TIM3RST_Pos,
    },
    {
        TIM3_IRQn,1,3,
    },
    {
        TIM3_BASE,
        7200-1,//    sj_int8   prescaler;
        1000-1,//    sj_int8   period;
        TIM_COUNTERMODE_UP,//    sj_int8   mode;
        TIM_CLOCKDIVISION_DIV1,//    sj_int8   division;
        3,
    },
};

static struct device timer3_device={
    "/dev/timer3",
    "timer",
     0,
    NULL,
    (sj_void *)&timer3_data,
};

static DEVICE_MODULE_INIT(timer3_device)


struct timer_device_data timer2_data=
{
    {
        1,RCC_APB1RSTR_TIM2RST_Pos,
    },
    {
        TIM2_IRQn,1,3,
    },
    {
        TIM2_BASE,
        7200-1,//    sj_int8   prescaler;
        50-1,//    sj_int8   period;
        TIM_COUNTERMODE_UP,//    sj_int8   mode;
        TIM_CLOCKDIVISION_DIV1,//    sj_int8   division;
        2,
    },
};

static struct device timer2_device={
    "/dev/timer2",
    "timer",
     0,
    NULL,
    (sj_void *)&timer2_data,
};

static DEVICE_MODULE_INIT(timer2_device)
